<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link href="default.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="all" href="skins/aqua/theme.css" title="Aqua" />
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="calendar-it.js"></script>


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<title>Registrazione</title>
<script type="text/javascript"  language="javascript">
                        <!--
                        function Controlla() {

                    if (document.registra.nome.value == ""){ alert('Hai mancato il campo NOME.');	document.registra.nome.focus(); return; }
                    if (document.registra.cognome.value == ""){ alert('Hai mancato il campo COGNOME.');	document.registra.cognome.focus(); return; }
                    if (document.registra.user.value == ""){ alert('Hai mancato il campo USERNAME.');	document.registra.user.focus(); return; }
                    if (document.registra.passworda.value == ""){ alert('Hai mancato il campo PASSWORD.');	document.registra.passworda.focus(); return; }
                    if (document.registra.passwordb.value == ""){ alert('Hai mancato il campo RIPETI PASSWORD.');	document.registra.passwordb.focus(); return; }

                    if (document.registra.passworda.value != document.registra.passwordb.value ){ alert('Digitare correttamente la PASSWORD.');	document.registra.passworda.focus(); return; }
                    document.registra.action="Jvinery/servlet/Registrazione";
                    //document.registra.submit();

                   }
                        //-->
                </script>


<script language="jvascript" type="text/javascript">
<!--
var oldLink = null;
function setActiveStyleSheet(link, title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
  if (oldLink) oldLink.style.fontWeight = 'normal';
  oldLink = link;
  link.style.fontWeight = 'bold';
  return false;
}

// This function gets called when the end-user clicks on some date.
function selected(cal, date) {
  cal.sel.value = date; // just update the date in the input field.
  if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
    cal.callCloseHandler();
}

function closeHandler(cal) {
  cal.hide();                        // hide the calendar
//  cal.destroy();
  _dynarch_popupCalendar = null;
}

function showCalendar(id, format, showsTime, showsOtherMonths) {
  var el = document.getElementById(id);
  if (_dynarch_popupCalendar != null) {
    // we already have some calendar created
    _dynarch_popupCalendar.hide();                 // so we hide it first.
  } else {
    // first-time call, create the calendar.
    var cal = new Calendar(1, null, selected, closeHandler);
    // uncomment the following line to hide the week numbers
    // cal.weekNumbers = false;
    if (typeof showsTime == "string") {
      cal.showsTime = true;
      cal.time24 = (showsTime == "24");
    }
    if (showsOtherMonths) {
      cal.showsOtherMonths = true;
    }
    _dynarch_popupCalendar = cal;                  // remember it in the global var
    cal.setRange(1900, 2070);        // min/max year allowed.
    cal.create();
  }
  _dynarch_popupCalendar.setDateFormat(format);    // set the specified date format
  _dynarch_popupCalendar.parseDate(el.value);      // try to parse the text in field
  _dynarch_popupCalendar.sel = el;                 // inform it what input field we use

  _dynarch_popupCalendar.showAtElement(el.nextSibling, "Br");        // show the calendar

  return false;
}

var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;

function isDisabled(date) {
  var today = new Date();
  return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}

function flatSelected(cal, date) {
  var el = document.getElementById("preview");
  el.innerHTML = date;
}

function showFlatCalendar() {
  var parent = document.getElementById("display");

  var cal = new Calendar(0, null, flatSelected);

  cal.weekNumbers = false;

  cal.setDisabledHandler(isDisabled);
  cal.setDateFormat("%A, %B %e");

  cal.create(parent);

  cal.show();
}
//-->
</script>
</head>

<body>
<div id="wrapper">
  <div id="header">
    <div id="logo">
      <h1><a href="#">baronerosso.it</a></h1>
     </div>
    <!-- end div#logo -->
  </div>
  <!-- end div#header -->
  <div id="menu">
    <ul>
      <li><a href="#">Home</a></li>
      <li><a href="#">Gruppo</a></li>
      <li><a href="#">contatti</a></li>
      <li class="active"><a href="#">registrazione</a></li>
    </ul>
  </div>
  <!-- end div#menu -->
  <div id="page">
    <div id="page-bgtop">
      <div id="content">
        <div class="post">
          <h2 class="title"><a href="#">Registrazione</a></h2>
          <p class="byline">In questa pagina hai la possibilità di registrarti come dipendente della nostra azienda</p>
          <div class="entry">
              
              <legend>Tutti i campi sono obbligatori:</legend>
                
              <br/><br/>

                       
              <form action="" name="registra" method="post" onsubmit="Controlla()">
                  <fieldset>
                Nome: <input type="text" name="nome" value="" size="15" maxlength="20" /><br/>
                Cognome: <input type="text" name="cognome" value="" size="15" maxlength="20" /><br/>
                Data di nascita: <input type="text" name="date3" id="sel3" size="30"/><input type="reset" value=" ... " onclick="showCalendar('sel3', '%Y/%m/%d')"/><br/>
                Username: <input type="text" name="user" value="" size="15" maxlength="20" /><br/>
                Password <input type="password" name="passworda" size="15" maxlength="20"/><br/>
                Password <input type="password" name="passwordb" size="15" maxlength="20"/><br/>
                <br/>
               Work<br/>
                <input name="ruolo" type="radio" value="Oenologist" checked/>Oenologist<br/>
                  <input name="ruolo" type="radio" value="Agronomus"/>Agronomus<br/>
                  <input name="ruolo" type="radio" value="Seller"/>Seller<br/>
                  <input name="ruolo" type="radio" value="Warehouseman"/>Warehouseman<br/>
                  <br/>
                  <br/>
                  <input type="submit" value=" send "/>
                
          </fieldset>
         </form>
          </div>
        </div>
        
       </div>
         
      <!-- end div#content -->

      <div style="clear: both; height: 1px"></div>
    </div>
  </div>
  <!-- end div#page -->
  <div id="footer">
    <p>Copyright releone7<br />Designed by Rinaldo Leone </p>
  </div>
  <!-- end div#footer -->
</div>
<!-- end div#wrapper -->
</body>
</html>